//
//  ALPS_DiscoveryCollectionViewCell.m
//  Alps
//
//  Created by dllo on 16/6/7.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ALPS_DiscoveryCollectionViewCell.h"

@implementation ALPS_DiscoveryCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.buttonImage = [[UIImageView alloc] initWithFrame:CGRectMake(15, 10, ScreeWidth / 4.5 - 30, ScreeWidth / 4.5 - 30)];
        [self.contentView addSubview:_buttonImage];
        
        self.titleLabel = [[UILabel alloc] init];
        self.titleLabel.textAlignment = 1;
        self.titleLabel.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:_titleLabel];
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_offset(UIEdgeInsetsMake(ScreeHeight / 20 * 3 - 30, 0, 5, 0));
        }];
    }
    return self;
}

- (void)setModel:(ALPS_MainModel *)model
{
    if (_model != model) {
        _model = model;
        [self.buttonImage sd_setImageWithURL:[NSURL URLWithString:model.coverPath]];
        self.titleLabel.text = model.title;
    }
}
@end
